One form of digital representation of images is a bitmap. In representing an image in a bitmap, the image is divided into an array of picture elements (pixels) and there is a one-to-one correspondence between pixels and digital storage. In its simplest form there is one bit of storage for each pixel; this is a binary bitmap, which represents an image where each pixel is one of two values (typically displayed as black and white, and often referred to as "off" and "on"). If a bitmap includes a plurality of bits for each pixel, then pixels can be different colors or gray levels. For example, with four bits per pixel, each pixel can have one of sixteen values; sixteen-valued pixels may be displayed as sixteen gray levels, sixteen different colors, or any sixteen combinations of intensity and color.
A bitmap representation of an image can be used in a variety of ways, such as: refreshing a video display, outputting on a printer, storing in RAM or in a disk file, image processing to enhance or combine images.
It is possible to represent in bitmap form an image that has more gray levels than the bitmap has values per pixel. The simplest case is the use of a binary bitmap to represent images having gray scale. In this case, although each pixel will be either black or white, regions of the image encompassing pluralities of pixels will have apparent gray scale corresponding to the ratio of the number of black to the number of white pixels in the region. It is often desirable to convert the resolution of a bitmap image (i.e., change the size of the bitmap array used to represent an image). This may be desirable in order to adjust for output devices of different resolution (i.e., that print different numbers of dots per inch) or to change the size of an image to fit a predetermined space (in which case the operation may be referred to as scaling).
One way to accomplish a reduction in resolution is to set each output pixel to the value of one of the input pixels, and ignore the other input pixels. This approach will lead to artifacts when the pattern of input-to-output mapping correlates with dot patterns in the image: for example, if an image being subjected to a 2:1 reduction has a region where every other pixel is "on", then that region (which appeared as 50% gray level in the input) will be either all "on" or all "off" in the output (i.e., 0% or 100% gray level).
Another way to accomplish resolution conversion involve defining a mapping of input pixels to output pixels where all input pixels are used and where a plurality of input pixels are mapped to single output pixels. The value of an output pixel is determined by the average of the values of the mapped input pixels. This method has the limitation that, because the output pixels are represented by digital values, the output pixels will not in general be able to represent precisely the average of the corresponding input pixel values. A conversion by 2:1 horizontally and 2:1 vertically will serve as an example. In this case, there are four input pixels for each output pixel, and therefore the average of the input pixels that correspond to a single output pixel can have one of five values (there can be 0, 1, 2, 3, or 4 pixels "on" at one time); yet each output pixel can have only one of two values. Output pixel values could be determined as follows: 0-2 input pixels "on" results in the output pixel being "off", and 3- 4 input pixels being "on" results in the output pixel being "on". If this method is used, then a region in the input image that had one quarter of the pixels "on" will result in the corresponding region of the output image having none of the pixels "on", and a region in the input image that had three quarters of the pixels "on" will result in the corresponding region of the output image having all of the pixels "on". This means that some of the gray scale representation will be lost.
When converting the resolution of an image having gray scale, it is desirable to maintain the gray scale in the converted image. It is particularly difficult to do so when gray scale is represented in a macroscopic way, in other words, by more than individual pixel values (for example, by the ratio of the numbers of "on" pixels to "off" pixels).
It is an object of the present invention to accomplish resolution conversion while maintaining gray scale, even when gray scale is represented macroscopically.